package com.centronix.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the purchase database table.
 * 
 */
@Entity
public class Purchase implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="purchaseId")
	private int purchaseId;

	private String batchNo;

	private int cottonUnits;

    @Temporal( TemporalType.DATE)
	private Date purcahseDate;

	private int units;

	//bi-directional many-to-one association to Product
    @ManyToOne
	@JoinColumn(name="ProductId")
	private Product product;

	//bi-directional many-to-one association to Stock
	@OneToMany(mappedBy="purchase")
	private List<Stock> stocks;

    public Purchase() {
    }

	public int getPurchaseId() {
		return this.purchaseId;
	}

	public void setPurchaseId(int purchaseId) {
		this.purchaseId = purchaseId;
	}

	public String getBatchNo() {
		return this.batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public int getCottonUnits() {
		return this.cottonUnits;
	}

	public void setCottonUnits(int cottonUnits) {
		this.cottonUnits = cottonUnits;
	}

	public Date getPurcahseDate() {
		return this.purcahseDate;
	}

	public void setPurcahseDate(Date purcahseDate) {
		this.purcahseDate = purcahseDate;
	}

	public int getUnits() {
		return this.units;
	}

	public void setUnits(int units) {
		this.units = units;
	}

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}
	
	public List<Stock> getStocks() {
		return this.stocks;
	}

	public void setStocks(List<Stock> stocks) {
		this.stocks = stocks;
	}
	
}